const GET_SERVICE_INFO = 'GET_SERVICE_INFO'

const state = {
    serviceData: {},
}

const getters = {
    serviceData: state => state.serviceData,
}

const actions = {
    storeServiceInfo({commit}, account) {
       commit(GET_SERVICE_INFO, account)
    }
}

const mutations = {
    [GET_SERVICE_INFO](state, account) {
        let realAccount = {};
        for (let [key, value] of Object.entries(account)) {
            if (account[key]) {realAccount[key] = value}
        }
        state.serviceData = realAccount
    }
}

export default {
    state,
    getters,
    actions,
    mutations
}
